<template>
    <div class="modal">
        <div class="box">
            <div class="text">{{ msg }}</div>
            <button class="btn" type="button" @click="emit('click')">确定</button>           
        </div>
    </div>
</template>

<script setup>
import { defineEmits, defineProps } from 'vue';
const emit = defineEmits(['click']);
defineProps({
    msg: {
        type: String,
        required: true,
    },
})
</script>
<style scoped>
.btn {
    padding: 5px 10px;
}
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.box {
    background-color: white;
    padding: 20px;
    border-radius: 10px;   
    width: 400px;
    height: 300px;    
}
</style>

